HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/third_party/prompt_toolkit/contrib/telnet/application.py
"""
Interface for Telnet applications.
"""
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass

__all__ = (
    'TelnetApplication',
)


class TelnetApplication(with_metaclass(ABCMeta, object)):
    """
    The interface which has to be implemented for any telnet application.
    An instance of this class has to be passed to `TelnetServer`.
    """
    @abstractmethod
    def client_connected(self, telnet_connection):
        """
        Called when a new client was connected.

        Probably you want to call `telnet_connection.set_cli` here to set a
        the CommandLineInterface instance to be used.
        Hint: Use the following shortcut: `prompt_toolkit.shortcuts.create_cli`
        """

    @abstractmethod
    def client_leaving(self, telnet_connection):
        """
        Called when a client quits.
        """